import request from '@/utils/request'

// 查询应用市场列表
export function getMarketList(query) {
  return request({
    url: '/market/list',
    method: 'get',
    params: query
  })
}

// 应用市场卸载安装
export function installApp(data) {
  return request({
    url: '/market/installApp',
    method: 'post',
    data: data
  })
}

// 应用市场卸载安装
export function getAppInfo(data) {
  return request({
    url: '/market/getAppInfo?appId=' + data,
    method: 'get',
    data: data
  })
}

export function getBoutiqueApps(query) {
  return request({
    url: '/market/getBoutiqueApps',
    method: 'get',
    params: query
  })
}

// 查询已安装的应用
export function getInstallAppInfo(query) {
  return request({
    url: '/market/getInstallAppInfo',
    method: 'get',
    params: query
  })
}

// 根据参数查询应用
export function getAppList(query) {
  return request({
    url: '/market/appList',
    method: 'get',
    params: query
  })
}

// 生成微信付款二维码
export function createQRCode(query) {
  return request({
    url: '/appPay/createQRCode',
    method: 'get',
    params: query
  })
}

/**
 * 查询微信支付订单
 * @param {*} data
 * @returns
 */
export function orderQuery(data) {
  return request({
    url: '/appPay/queryOrder',
    method: 'post',
    data: data
  })
}

/**
 * 申请微信支付退款
 * @param {*} data
 * @returns
 */
export function refund(data) {
  return request({
    url: '/appPay/refund',
    method: 'post',
    data: data
  })
}
